<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Hard
  </div>
  <div>
   <h1 class="question_title">
    315. Count of Smaller Numbers After Self
   </h1>
   <p>
    You are given an integer array
    <i>
     nums
    </i>
    and you have to return a new
    <i>
     counts
    </i>
    array. The
    <i>
     counts
    </i>
    array has the property where
    <code>
     counts[i]
    </code>
    is the number of smaller elements to the right of
    <code>
     nums[i]
    </code>
    .
   </p>
   <p>
    <b>
     Example:
    </b>
   </p>
   <pre>
<strong>Input:</strong> [5,2,6,1]
<strong>Output:</strong> <code>[2,1,1,0] 
<strong>Explanation:</strong></code>
To the right of 5 there are <b>2</b> smaller elements (2 and 1).
To the right of 2 there is only <b>1</b> smaller element (1).
To the right of 6 there is <b>1</b> smaller element (1).
To the right of 1 there is <b>0</b> smaller element.
</pre>
  </div>
  <div>
   <h1 class="question_title">
    315. 计算右侧小于当前元素的个数
   </h1>
   <p>
    给定一个整数数组
    <em>
     nums
    </em>
    ，按要求返回一个新数组&nbsp;
    <em>
     counts
    </em>
    。数组
    <em>
     counts
    </em>
    有该性质：
    <code>
     counts[i]
    </code>
    的值是&nbsp;
    <code>
     nums[i]
    </code>
    右侧小于&nbsp;
    <code>
     nums[i]
    </code>
    的元素的数量。
   </p>
   <p>
    <strong>
     示例:
    </strong>
   </p>
   <pre><strong>输入:</strong> [5,2,6,1]
<strong>输出:</strong> <code>[2,1,1,0] 
<strong>解释:</strong></code>
5 的右侧有 <strong>2 </strong>个更小的元素 (2 和 1).
2 的右侧仅有 <strong>1 </strong>个更小的元素 (1).
6 的右侧有 <strong>1 </strong>个更小的元素 (1).
1 的右侧有 <strong>0 </strong>个更小的元素.
</pre>
  </div>
 </body>
</html>